<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>子元素过滤器</title>
</head>
<body>
	<div>
		<p>a</p>
		<p>b</p>
	</div>
	<div>
		<p>c</p>
		<p>d</p>
	</div>
	<div></div>

	<ul>
		<li><a href="">导航</a></li>
		<li><span>s</span><a href="">导航</a></li>
	</ul>
</body>
<script type="text/javascript" src="./jquery-3.1.1.js"></script>
<script type="text/javascript">
 	//同一个层次下最后一个p标签
 	$('p:last-of-type').css('background','silver');
 	//匹配li下的独生a标签
 	$('li a:only-child').css('background','olive');
</script>
</html>